﻿Imports System.Windows
Imports System.ComponentModel
Imports System.Windows.Media

Public Class Extender
    Inherits DependencyObject


    Public Shared Function GetBackground(ByVal element As DependencyObject) As Brush
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(BackgroundProperty)
    End Function

    Public Shared Sub SetBackground(ByVal element As DependencyObject, ByVal value As Brush)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(BackgroundProperty, value)
    End Sub

    Public Shared ReadOnly BackgroundProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Background", _
                           GetType(Brush), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetBorderBrush(ByVal element As DependencyObject) As Brush
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(BorderBrushProperty)
    End Function

    Public Shared Sub SetBorderBrush(ByVal element As DependencyObject, ByVal value As Brush)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(BorderBrushProperty, value)
    End Sub

    Public Shared ReadOnly BorderBrushProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("BorderBrush", _
                           GetType(Brush), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetBorderThickness(ByVal element As DependencyObject) As Thickness
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(BorderThicknessProperty)
    End Function

    Public Shared Sub SetBorderThickness(ByVal element As DependencyObject, ByVal value As Thickness)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(BorderThicknessProperty, value)
    End Sub

    Public Shared ReadOnly BorderThicknessProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("BorderThickness", _
                           GetType(Thickness), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetCornerRadius(ByVal element As DependencyObject) As CornerRadius
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(CornerRadiusProperty)
    End Function

    Public Shared Sub SetCornerRadius(ByVal element As DependencyObject, ByVal value As CornerRadius)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(CornerRadiusProperty, value)
    End Sub

    Public Shared ReadOnly CornerRadiusProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", _
                           GetType(CornerRadius), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFocusable(ByVal element As DependencyObject) As Boolean
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FocusableProperty)
    End Function

    Public Shared Sub SetFocusable(ByVal element As DependencyObject, ByVal value As Boolean)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FocusableProperty, value)
    End Sub

    Public Shared ReadOnly FocusableProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Focusable", _
                           GetType(Boolean), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFontFamily(ByVal element As DependencyObject) As FontFamily
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FontFamilyProperty)
    End Function

    Public Shared Sub SetFontFamily(ByVal element As DependencyObject, ByVal value As FontFamily)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FontFamilyProperty, value)
    End Sub

    Public Shared ReadOnly FontFamilyProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("FontFamily", _
                           GetType(FontFamily), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFontSize(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FontSizeProperty)
    End Function

    Public Shared Sub SetFontSize(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FontSizeProperty, value)
    End Sub

    Public Shared ReadOnly FontSizeProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("FontSize", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFontStretch(ByVal element As DependencyObject) As FontStretch
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FontStretchProperty)
    End Function

    Public Shared Sub SetFontStretch(ByVal element As DependencyObject, ByVal value As FontStretch)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FontStretchProperty, value)
    End Sub

    Public Shared ReadOnly FontStretchProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("FontStretch", _
                           GetType(FontStretch), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFontStyle(ByVal element As DependencyObject) As FontStyle
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FontStyleProperty)
    End Function

    Public Shared Sub SetFontStyle(ByVal element As DependencyObject, ByVal value As FontStyle)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FontStyleProperty, value)
    End Sub

    Public Shared ReadOnly FontStyleProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("FontStyle", _
                           GetType(FontStyle), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFontWeight(ByVal element As DependencyObject) As FontWeight
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FontWeightProperty)
    End Function

    Public Shared Sub SetFontWeight(ByVal element As DependencyObject, ByVal value As FontWeight)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FontWeightProperty, value)
    End Sub

    Public Shared ReadOnly FontWeightProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("FontWeight", _
                           GetType(FontWeight), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetForeground(ByVal element As DependencyObject) As Brush
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(ForegroundProperty)
    End Function

    Public Shared Sub SetForeground(ByVal element As DependencyObject, ByVal value As Brush)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(ForegroundProperty, value)
    End Sub

    Public Shared ReadOnly ForegroundProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Foreground", _
                           GetType(Brush), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetFormat(ByVal element As DependencyObject) As String
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(FormatProperty)
    End Function

    Public Shared Sub SetFormat(ByVal element As DependencyObject, ByVal value As String)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(FormatProperty, value)
    End Sub

    Public Shared ReadOnly FormatProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Format", _
                           GetType(String), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetHeight(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(HeightProperty)
    End Function

    Public Shared Sub SetHeight(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(HeightProperty, value)
    End Sub

    Public Shared ReadOnly HeightProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Height", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetHorizontalAlignment(ByVal element As DependencyObject) As HorizontalAlignment
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(HorizontalAlignmentProperty)
    End Function

    Public Shared Sub SetHorizontalAlignment(ByVal element As DependencyObject, ByVal value As HorizontalAlignment)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(HorizontalAlignmentProperty, value)
    End Sub

    Public Shared ReadOnly HorizontalAlignmentProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("HorizontalAlignment", _
                           GetType(HorizontalAlignment), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetHorizontalContentAlignment(ByVal element As DependencyObject) As HorizontalAlignment
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(HorizontalContentAlignmentProperty)
    End Function

    Public Shared Sub SetHorizontalContentAlignment(ByVal element As DependencyObject, ByVal value As HorizontalAlignment)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(HorizontalContentAlignmentProperty, value)
    End Sub

    Public Shared ReadOnly HorizontalContentAlignmentProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("HorizontalContentAlignment", _
                           GetType(HorizontalAlignment), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetLayoutTransform(ByVal element As DependencyObject) As RotateTransform
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(LayoutTransformProperty)
    End Function

    Public Shared Sub SetLayoutTransform(ByVal element As DependencyObject, ByVal value As RotateTransform)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(LayoutTransformProperty, value)
    End Sub

    Public Shared ReadOnly LayoutTransformProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("LayoutTransform", _
                           GetType(RotateTransform), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetMargin(ByVal element As DependencyObject) As Thickness
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(MarginProperty)
    End Function

    Public Shared Sub SetMargin(ByVal element As DependencyObject, ByVal value As Thickness)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(MarginProperty, value)
    End Sub

    Public Shared ReadOnly MarginProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Margin", _
                           GetType(Thickness), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetMaxHeight(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(MaxHeightProperty)
    End Function

    Public Shared Sub SetMaxHeight(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(MaxHeightProperty, value)
    End Sub

    Public Shared ReadOnly MaxHeightProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("MaxHeight", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetMaxWidth(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(MaxWidthProperty)
    End Function

    Public Shared Sub SetMaxWidth(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(MaxWidthProperty, value)
    End Sub

    Public Shared ReadOnly MaxWidthProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("MaxWidth", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetMinHeight(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(MinHeightProperty)
    End Function

    Public Shared Sub SetMinHeight(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(MinHeightProperty, value)
    End Sub

    Public Shared ReadOnly MinHeightProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("MinHeight", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetMinWidth(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(MinWidthProperty)
    End Function

    Public Shared Sub SetMinWidth(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(MinWidthProperty, value)
    End Sub

    Public Shared ReadOnly MinWidthProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("MinWidth", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetPadding(ByVal element As DependencyObject) As Thickness
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(PaddingProperty)
    End Function

    Public Shared Sub SetPadding(ByVal element As DependencyObject, ByVal value As Thickness)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(PaddingProperty, value)
    End Sub

    Public Shared ReadOnly PaddingProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Padding", _
                           GetType(Thickness), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetRenderTransform(ByVal element As DependencyObject) As RotateTransform
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(RenderTransformProperty)
    End Function

    Public Shared Sub SetRenderTransform(ByVal element As DependencyObject, ByVal value As RotateTransform)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(RenderTransformProperty, value)
    End Sub

    Public Shared ReadOnly RenderTransformProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("RenderTransform", _
                           GetType(RotateTransform), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetRenderTransformOrigin(ByVal element As DependencyObject) As Point
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(RenderTransformOriginProperty)
    End Function

    Public Shared Sub SetRenderTransformOrigin(ByVal element As DependencyObject, ByVal value As Point)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(RenderTransformOriginProperty, value)
    End Sub

    Public Shared ReadOnly RenderTransformOriginProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("RenderTransformOrigin", _
                           GetType(Point), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetTextAlignment(ByVal element As DependencyObject) As TextAlignment
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(TextAlignmentProperty)
    End Function

    Public Shared Sub SetTextAlignment(ByVal element As DependencyObject, ByVal value As TextAlignment)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(TextAlignmentProperty, value)
    End Sub

    Public Shared ReadOnly TextAlignmentProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("TextAlignment", _
                           GetType(TextAlignment), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetTextDecorations(ByVal element As DependencyObject) As TextDecorationCollection
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(TextDecorationsProperty)
    End Function

    Public Shared Sub SetTextDecorations(ByVal element As DependencyObject, ByVal value As TextDecorationCollection)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(TextDecorationsProperty, value)
    End Sub

    Public Shared ReadOnly TextDecorationsProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("TextDecorations", _
                           GetType(TextDecorationCollection), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetTextTrimming(ByVal element As DependencyObject) As TextTrimming
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(TextTrimmingProperty)
    End Function

    Public Shared Sub SetTextTrimming(ByVal element As DependencyObject, ByVal value As TextTrimming)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(TextTrimmingProperty, value)
    End Sub

    Public Shared ReadOnly TextTrimmingProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("TextTrimming", _
                           GetType(TextTrimming), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetTextWrapping(ByVal element As DependencyObject) As TextWrapping
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(TextWrappingProperty)
    End Function

    Public Shared Sub SetTextWrapping(ByVal element As DependencyObject, ByVal value As TextWrapping)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(TextWrappingProperty, value)
    End Sub

    Public Shared ReadOnly TextWrappingProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("TextWrapping", _
                           GetType(TextWrapping), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetVerticalAlignment(ByVal element As DependencyObject) As VerticalAlignment
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(VerticalAlignmentProperty)
    End Function

    Public Shared Sub SetVerticalAlignment(ByVal element As DependencyObject, ByVal value As VerticalAlignment)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(VerticalAlignmentProperty, value)
    End Sub

    Public Shared ReadOnly VerticalAlignmentProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("VerticalAlignment", _
                           GetType(VerticalAlignment), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetVerticalContentAlignment(ByVal element As DependencyObject) As VerticalAlignment
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(VerticalContentAlignmentProperty)
    End Function

    Public Shared Sub SetVerticalContentAlignment(ByVal element As DependencyObject, ByVal value As VerticalAlignment)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(VerticalContentAlignmentProperty, value)
    End Sub

    Public Shared ReadOnly VerticalContentAlignmentProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("VerticalContentAlignment", _
                           GetType(VerticalAlignment), GetType(Extender), _
                           New PropertyMetadata(Nothing))



    Public Shared Function GetWidth(ByVal element As DependencyObject) As Double
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(WidthProperty)
    End Function

    Public Shared Sub SetWidth(ByVal element As DependencyObject, ByVal value As Double)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(WidthProperty, value)
    End Sub

    Public Shared ReadOnly WidthProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("Width", _
                           GetType(Double), GetType(Extender), _
                           New PropertyMetadata(Nothing))
End Class